import axios from 'axios'

const instance = axios.create({
  baseURL:"http://kumanxuan1.f3322.net:8001",
  timeout:5000
})

instance.interceptors.request.use(config=>{

  // 获取token，判断用户是否登录
  let token=localStorage.getItem("token")
  if(token){
    config.headers["X-Nideshop-Tokken"] = token
  }

  return config
},error => {

  return Promise.reject(error)
})

instance.interceptors.response.use(res=>{



  return res.data
},error => {
  return Promise.reject(error)
})

export default  instance
